﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Fee.ViewModel
{
    public class ProjectDetailViewModel
    {
        public ProjectDetailViewModel()
        {
        }

        public ProjectDetailViewModel(Project project)
        {
            Name = project.Name;
            YearTargetDesscription = project.YearTargetDesscription;
            Comment = Comment;
            Id = project.Id;

  
        }

        public IList<FrameworkContractSimpleViewModel> FrameworkContracts { get; set; } =
            new List<FrameworkContractSimpleViewModel>();

        /// <summary>
        ///     项目
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        ///     描述
        /// </summary>
        public string Comment { get; set; }

        /// <summary>
        ///     项目编码
        /// </summary>
        public string No { get; set; }

        /// <summary>
        ///     下达年份
        /// </summary>
        public int CreateYear { get; set; }

        /// <summary>
        ///     首次下达日期
        /// </summary>
        public DateTimeOffset? FirstOrderTime { get; set; }

        public DateTimeOffset? LastOrderTime { get; set; }

        /// <summary>
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        ///     进度
        /// </summary>
        public LevelProcess LevelProcess { get; set; }

        /// <summary>
        ///     项目投资，不含税（万元为单位)
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        ///     建设期限
        /// </summary>
        public string ConstructionLimitationComment { get; set; }

        /// <summary>
        ///     建设内容
        /// </summary>
        public string ConstructionContent { get; set; }

        /// <summary>
        ///     站点规模数
        /// </summary>
        public int Station { get; set; }

        /// <summary>
        ///     年度目标
        /// </summary>
        public string YearTargetDesscription { get; set; }


        public ProjectStatus Status { get; set; }

        /// <summary>
        ///     负责人
        /// </summary>
        public string Owner { get; set; }

        public StationType StationType { get; set; }

        public Project ToProject()
        {
            return new Project
            {
                Name = Name,
                Id = Id,
                YearTargetDesscription = YearTargetDesscription,
                Comment = Comment,
                Amount = Amount,
                Owner = Owner,
                StationType = StationType,
                Status = Status,
                ConstructionContent = ConstructionContent,
                ConstructionLimitationComment = ConstructionLimitationComment
            };
        }
    }
}